package com.itheima;

import com.itheima.service.StudentService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author cp
 * @className StudentApp
 * @description TODO
 * @create 2020/12/4 15:09
 **/
public class StudentApp {
    public static void main(String[] args) {
        //1. 获取核心容器对象
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");

        //2. 获取Service
        StudentService service1 = (StudentService) applicationContext.getBean("studentService");
        StudentService service2 = (StudentService) applicationContext.getBean("studentService");

        service1.study();
        service2.study();
    }
}
